Add the content used by the dynamic object generator

In this step you add the content to the Kanzi Studio project that the dynamic object generator loads. In the last part of this step you export the .kzb binary of the Kanzi Studio project. When you complete the next step of this tutorial your application loads this .kzb binary when you launch your Kanzi application.

Create the prefab for the items in the trajectory list box

To create the prefab that holds the content for each item that the trajectory list box shows:

  1. In the Project > Prefabs create the prefab that holds the content for each item that the trajectory list box shows.
    For example, create a Plane, name it Item. Under the Item create a Grid Layout, and under the Grid Layout create a Plane, and a Text Block.
  2. In the Project > Prefabs select the Item and in the Properties add and set:
  3. In the Project > Prefabs > Item > Grid Layout select the Plane and in the Properties add and set:
  4. In the Project > Prefabs > Item select the Text Block and in the Properties add and set the binding property to create a binding that binds the Text property to the {../../TextBlock.Text}.
    This binding enables you to control the text in each item shown in the trajectory list box through the C application.
  5. In the Project > Prefabs > Item select the Grid Layout and in the Properties add and set:

Create and set up the trajectory list box

To create and set up the trajectory list box that into which the object generator loads the prefabs:

  1. In the Project > Prefabs create a Trajectory List Box that defines the position of the list box in the scene and holds the items users can scroll, and in the Properties add these properties:

  2. Drag the Trajectory List Box prefab to the Scene to instantiate it there.
  3. In the Library > Trajectories select the Circle Trajectory and in the Properties set the Radius property to 20.

Adjust the camera

To adjust the camera so that it shows the trajectory list box from inside the circle trajectory, in the Project select Screen > Root Layer > Viewport Layer > Scene > Camera and in the Properties set the Transformation property attributes. For example, use these attributes:

Create the highlight animation

When you select an item in the trajectory list box, the application plays the highlight animation to show which item in the trajectory list box is currently selected.

You only need to create the animation to show that the item is selected. You use the same animation to show that an item in the trajectory list box is not selected anymore by playing the same animation in reverse. You trigger both animations from the C application.

To create the highlight animation:

  1. In the Library right-click Animations, select Create > Animation Clip, then right-click the animation clip you created, and select Create > Animation.
    For example, name the animation clip Highlight and the animation Pop.
  2. In the Library select the animation Pop, and in the Properties set the Property Attribute to Translation Z.
    This animation changes only the value of the Translation Z attribute of the Transformation property to create an animation that brings the selected item slightly forward.
  3. In the Library > Library tab double-click the Highlight animation.
    The Animation Clip Editor opens.
  4. In the Animation Clip Editor select the Move tool and in the animation canvas click the animation Lift animation to select it.
  5. Select the Keyframe tool and in the animation canvas create two keyframes by clicking the animation.
  6. Select the Move tool, select the first keyframe, and set:
  7. Select the second keyframe and set:

Export the .kzb binary

When you complete the work in the Kanzi Studio project, export the .kzb binary of the project. The application you create in the next step of this tutorial loads this binary when you run the application.

In Kanzi Studio select File > Export KZB Binary.
Kanzi Studio creates the binary and configuration files from your Kanzi Studio project and stores them in <KanziWorkspace>/Projects/<ProjectName>/Application/bin. When you run your Kanzi application from Visual Studio, your Visual Studio solution reads these files to create your Kanzi application.

< PREVIOUS STEP

NEXT STEP >

See also

Creating and editing prefabs

Using bindings

Using trajectory list boxes

Using line trajectories

Animating movement

Editing animation clips